<!-- 导航图标-侧滑展示 -->
<template>
    <layout-pane label="展示">
        <div class="row-item">
            <div class="col-item">
                <div
                    class="album-list-show"
                    :class="{ 'active': isSideslip === false }"
                    @click="isSideslip = false"
                >
                    <div class="album-mode-one">
                        <span></span>
                        <span></span>
                        <span></span>
                        <span></span>
                    </div>
                </div>
                <div class="album-list-title">固定列表</div>
            </div>
            
            <div class="col-item">
                <div
                    class="album-list-show"
                    :class="{ 'active': isSideslip === true }"
                    @click="isSideslip = true"
                >
                    <div class="album-mode-two">
                        <span class="half"></span>
                        <span></span>
                        <span class="half"></span>
                    </div>
                </div>
                <div class="album-list-title">横向滚动</div>
            </div>
        </div>
    </layout-pane>
</template>

<script>
import { defineComponent, toRefs, computed } from 'vue'
import LayoutPane from '@/components/setting-pane/layout-pane'
export default defineComponent({
    name: 'NavIconIsSideslip',
    components: {
        LayoutPane
    },
    props: {
        widget: {
            type: Object,
            default: () => ({})
        }
    },
    setup(props) {
        const { widget } = toRefs(props)

        const isSideslip = computed({
            get: () => widget.value.widgetData.eles.customFeature.isSideslip,
            set: val => widget.value.widgetData.eles.customFeature.isSideslip = val
        })

        return {
            widget,
            isSideslip
        }
    }
})
</script>

<style lang="less" scoped>
.row-item {
    display: flex;
    align-items: center;
    .col-item {
        & + .col-item {
            margin-left: 12px;
        }
    }
}
.album-list-show {
    display: inline-block;
    width: 70px;
    height: 70px;
    border: 1px solid var(--edit-border-color-darker);
    padding: 5px;
    margin: 0 10px 10px;
    vertical-align: top;
    box-sizing: content-box;
    cursor: pointer;
    &.active {
        border-color: var(--edit-color-primary);
    }
    .album-mode-one {
        background-color: var(--edit-border-color);
        padding: 5px;
        height: 60px;
        box-sizing: content-box;
        overflow: hidden;
        span {
            width: 28px;
            height: 28px;
            float: left;
            margin: 1px;
            background-color: var(--edit-text-color-disabled);
        }
    }
    .album-mode-two {
        background-color: var(--edit-border-color);
        height: 70px;
        line-height: 70px;
        display: flex;
        align-items: center;
        span {
            display: inline-block;
            width: 28px;
            height: 28px;
            background-color: var(--edit-text-color-disabled);
            vertical-align: middle;
            margin: 0 5px;
        }
        .half {
            display: inline-block;
            width: 16px;
            height: 28px;
            background-color: var(--edit-text-color-disabled);
            vertical-align: middle;
            margin: 0;
        }
    }
}
.album-list-title {
    text-align: center;
    color: var(--edit-color-info);
}
</style>